import click
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields


CUSTOM_FIELDS = {
    "Work Order": [
        {
            "label": "流程卡",
            "fieldname": "process_card_tab",
            "fieldtype": "Tab Break",
            "hidden": 0,
            "insert_after": "connections_tab",
        },
        {
            "label": "批次大小",
            "fieldname": "process_card_batch_size",
            "fieldtype": "Float",
            "hidden": 0,
            "insert_after": "process_card_tab",
        },
        {
            "label": "流程卡明细",
            "fieldname": "process_card_list",
            "fieldtype": "Table",
            "hidden": 0,
            "options": "emes_process_card",
            "insert_after": "process_card_batch_size",
        },
    ],
    "Job Card Time Log": [
        {
            "label": "流程卡号",
            "fieldname": "process_card_no",
            "fieldtype": "Data",
            "hidden": 0,
            "readonly": 1,
			"in_list_view": 1,
			"Columns":2,
            "insert_after": "employee",
        },
    ],
}


def after_install():
    create_custom_fields(CUSTOM_FIELDS, ignore_validate=True)
